package com.bihu.bihudemo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bihu.bihudemo.entity.Question;
import com.bihu.bihudemo.entity.vo.QuestionVo;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * 文章(Question)表数据库访问层
 *
 * @author makejava
 * @since 2020-07-15 17:09:59
 */
public interface QuestionDao extends BaseMapper<Question> {

    IPage<QuestionVo> getAllArticles(Page<?> page);

    IPage<QuestionVo> getArticlesByTag(Page<?> page,@Param("tid") Integer tagID);

    IPage<QuestionVo>getArticlesByName(Page<?>page,@Param("title")String title);

    QuestionVo getOneByID(int aid);

    List<Question>getforkedQuestion(int uid);

    void likeQuestion(int qid);
}